home *** CD-ROM | disk | FTP | other *** search
/ Interactive Media Design Review 1999 / Interactive Media Design Review 1999.iso / pc / Demos / Bombardier_PC / BSCRIPTS.CST / 00084_Script_CDsmallMenu < prev    next >
Text File  |  1999-04-25  |  5KB  |  144 lines

  1. -- ⌐ 1998 @radical.media, inc. & Concurrent New Media Group, L.L.C.
  2. -- Developed for Bombardier, Inc.
  3. --
  4. -- All programming developed by: 
  5. -- Robert Fabricant, Valerie Valoueva, Ossi Shaked, 
  6. -- Henry Sauvageot, Chris Howell & Chris Girand
  7. --
  8. -- Use of this code by parties other than @radical.media, inc. or their
  9. --agents 
  10. -- without the express written consent of @radical.media, inc. AND Concurrent 
  11. -- New Media Group, L.L.C. is strictly prohibited.
  12. ------------------------------------------------------
  13.  
  14. property mySprite, NeutralName, HiliteName, linkedNumberGrayName, linkedFieldGrayName, selected, detailNum, linkedNumberHilName,linkedFieldHilName 
  15.  
  16. global currentDetail, nextDetail
  17. global linkedNumberNeutralName,linkedNumberSprite,linkedFieldNeutralName,linkedFieldSprite
  18.  
  19. on new me
  20.   set mySprite = the spriteNum of me  
  21.   set NeutralName = getNeutralName(me, mySprite)  
  22.   set detailNum = getDetailNum(me)  
  23.   if NeutralName contains "-hil" then--we are currently in this detail's section
  24.     set currentDetail = detailNum
  25.     set selected = 1
  26.     --  Detail's title consists of two sprites:
  27.     --  #bmp "Number" and  #richtext "Field". 
  28.     -- We have to find out in which channels they are located 
  29.     set linkedNumberNeutralName = detailNum & "head"--constract a Titles 
  30.     set linkedNumberSprite = getSpriteNumFromMemberName (linkedNumberNeutralName)
  31.     set linkedFieldNeutralName = detailNum & "headfield"
  32.     set linkedFieldSprite = getSpriteNumFromMemberName (linkedFieldNeutralName)
  33.   else
  34.     set selected = 0
  35.     -- Constract the names of cast members that will form the title 
  36.     -- when rolled over an item in the cabin details menu 
  37.     set HiliteName = NeutralName&"-hil"
  38.     set linkedNumberGrayName = detailNum & "head-gray"
  39.     set linkedNumberHilName = detailNum & "head"
  40.     set linkedFieldGrayName = detailNum & "headfield-gray"
  41.     set linkedFieldHilName = detailNum & "headfield"
  42.   end if
  43. end
  44.  
  45. on getDetailNum me
  46.   set myString = ""
  47.   repeat with i = 1 to the Number of Chars in NeutralName
  48.     set value = integer(char i of NeutralName)
  49.     if not(voidP(value)) then
  50.       set myString = myString&string(value)
  51.     else
  52.       exit repeat
  53.     end if
  54.   end repeat
  55.   
  56.   return myString
  57.   
  58. end
  59.  
  60.  
  61. on mouseEnter me
  62.   
  63.   if (the frameLabel contains "exit") or (the frameLabel contains "enter") then
  64.     --    Disable this handler if a frame transition is not over yet
  65.     nothing
  66.   else
  67.     if not selected then
  68.       set nextDetail = detailNum
  69.       set the member of sprite mySprite = member  HiliteName
  70.       set the member of sprite linkedNumberSprite = member  linkedNumberGrayName 
  71.       set the member of sprite linkedFieldSprite = member  linkedFieldGrayName
  72.       puppetsound 3, "newroll"
  73.     end if
  74.   end if
  75.   
  76. end
  77.  
  78. on mouseLeave me
  79.   if (the frameLabel contains "exit") or (the frameLabel contains "enter") then
  80.     --    Disable this handler if a frame transition is not over yet
  81.     nothing
  82.   else
  83.     if not selected then
  84.       set the member of sprite mySprite = member  NeutralName
  85.       set the member of sprite linkedNumberSprite = member linkedNumberNeutralName 
  86.       set the member of sprite linkedFieldSprite = member  linkedFieldNeutralName
  87.     end if
  88.   end if
  89. end
  90.  
  91. on mouseUp me
  92.   if (the frameLabel contains "exit") or (the frameLabel contains "enter") then
  93.     --    Disable this handler if a frame transition is not over yet
  94.     nothing
  95.   else
  96.     if not selected then
  97.       set the member of sprite linkedNumberSprite = member  linkedNumberHilName 
  98.       set the member of sprite linkedFieldSprite = member  linkedFieldHilName
  99.       go to frame "exit_det"& currentDetail
  100.       puppetsound 3, "newclick"
  101.     end if
  102.   end if
  103.   
  104. end
  105.  
  106. on CDSmallMenuPuppetsOff me
  107.   --  puppetsprite mySprite, false
  108.   --  puppetsprite linkedNumberSprite, false
  109.   --  puppetsprite linkedFieldSprite, false
  110. end
  111.  
  112.  
  113.  
  114.  
  115. on getNeutralName me,SpriteNum
  116.   set aMember = the member of sprite spriteNum
  117.   set Name = the name of member aMember
  118.   return Name
  119. end
  120.  
  121. on exitFrame me
  122.   if the frame = label("exit2_det"& currentDetail) then
  123.     --    sendAllSprites(#CDSmallMenuPuppetsOff)
  124.     repeat while soundbusy(3)
  125.     end repeat
  126.     go to "enter_det"&nextDetail
  127.     puppetTransition 02,8,1
  128.     puppetsound 3, "touranimrev"
  129.   end if
  130.   if the frame = label("exit_det"& currentDetail) then
  131.     puppetTransition 01,8,1
  132.     puppetsound 3, "touranim"
  133.   end if
  134. end
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.